<?php

namespace app\api\controller\xykeep;

use app\api\model\xykeep\goods\Order as OrderModel;
use app\api\model\xykeep\Take as TakeModel;
use app\api\model\xykeep\User;
use app\common\controller\Api;

class Take extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function bill()
    {
        $user = User::info();
        $take = TakeModel::where(['user_id'=>$user->id])->find();
        if(!$take){
            $this->error('暂未入驻自提点');
        }
        $lists = OrderModel::where(['take_id'=>$user->id])
            ->with(['user','item'])
            ->paginate();
        $this->success('自提订单',$lists);
    }
}